package org.hcyspartnoc.luoxin.common.enums.user;

import lombok.Getter;

@Getter
public enum UserContactTypeEnum {
    USER(1, "用户"),
    ROBOT(2, "机器人"),
    V_COUNSELOR(3, "虚拟咨询师"),
    GROUP(4, "群组");

    private final Integer code;
    private final String description;

    UserContactTypeEnum(int code, String description) {
        this.code = code;
        this.description = description;
    }

    public static UserContactTypeEnum getByCode(Integer code) {
        for (UserContactTypeEnum theEnum : UserContactTypeEnum.values()) {
            if (theEnum.getCode().equals(code)) {
                return theEnum;
            }
        }
        return null;
    }
}
